package org.code.mallspringboot.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.code.mallspringboot.dto.SmsProductRelationListDto;
import org.code.mallspringboot.dto.SmsSelectProductsDto;
import org.code.mallspringboot.pojo.SmsFlashPromotionProductRelation;

import java.util.List;

/**
 * @Entity org.code.mallspringboot.pojo.SmsFlashPromotionProductRelation
 */
@Mapper
public interface SmsFlashPromotionProductRelationMapper{

    /**
     查询 + 分页
     * @param pageNum
     * @param pageSize
     * @param flashPromotionId
     * @param flashPromotionSessionId
     * @return
     */
    List<SmsProductRelationListDto> selectPage(@Param("pageNum") Integer pageNum,
                                               @Param("pageSize")Integer pageSize,
                                               @Param("flashPromotionId")Integer flashPromotionId,
                                               @Param("flashPromotionSessionId")Integer flashPromotionSessionId);

    /**
     总条数
     * @param flashPromotionId
     * @param flashPromotionSessionId
     * @return
     */
    int total(@Param("flashPromotionId")Integer flashPromotionId,
              @Param("flashPromotionSessionId")Integer flashPromotionSessionId);

    /**
     修改
     * @param smsProductRelationListDto
     * @return
     */
    int update(SmsProductRelationListDto smsProductRelationListDto);

    /**
     添加
     * @param smsSelectProductsDto
     * @return
     */
    int add(SmsSelectProductsDto smsSelectProductsDto);

    /**
     删除
     * @param id
     * @return
     */
    int delete(@Param("id") int id);
}




